use crate::handle::generate;
use crate::CACHE;
use axum::{routing::get, Extension, Router};
use tower::ServiceBuilder;
use tower_http::trace::TraceLayer;


pub fn crate_router() -> Router {
    Router::new()
        .route("/image/:spec/:url", get(generate))
        .layer(ServiceBuilder::new().layer(TraceLayer::new_for_http()).layer(Extension(CACHE.clone())))
}
